package com.link.base.base.mpconfig.service;

import com.alibaba.fastjson.JSONObject;
import com.link.base.base.mpconfig.model.SendTempMessage;
import com.link.base.base.wechat.model.TemTable;
import com.link.core.basic.service.BasicService;

import java.util.Map;


/**
 * 发送模板消息
 *
 * @author: 闫有霞
 * @date: 2019/12/19
 */
public interface SendTempMessageService extends BasicService<SendTempMessage> {
    /**
     *@createdBy 闫有霞
     *@date 2018/12/14
     *@methods: getParams
     *@param: String tempRowId  模板记录ID
     *         String type 那种类型的模板
     *                     MP  小程序
     *                     WeChat 微信
     *                    SMS   短信
     *          String parentId 触发发送的订单ID
     *          String parentType 触发发送的ID类型 目前只支持订单触发-order  优惠券领取记录 - couponrec
     *@return: sendTempMessage  发送模板信息参数对象
     *@description: 获取发送模板信息的参数
     **/

    public SendTempMessage getParams(SendTempMessage entity)throws Exception;

    /**
     *@createdBy 闫有霞
     *@date 2018/12/14
     *@methods: getParaValue
     *@param: String paramId   参数记录ID
     *         String parentId 触发发送的订单ID
     *         String parentType 触发发送的ID类型 目前只支持订单触发-order  优惠券领取记录 - couponrec
     *@return: String value
     *@description: 获取参数具体值
     **/

    public String  getParaValue(SendTempMessage entity) throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/14
     * @methods: queryVauleByOrder
     * @param: temTable
     * @return: String value
     * @description: 以订单表为基准获取参数值
     **/

    public String queryVauleByOrder(TemTable temTable)throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/14
     * @methods: queryVauleByOrder
     * @param: temTable
     * @return: String value
     * @description: 以优惠券领取表为基准获取参数值
     **/
    public String queryVauleByCoupRec(TemTable temTable)throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/17
     * @methods: sendMpTemplate
     * @param: sendTempMessage
     * @return:  JSONObject
     * @description: 发送小程序模板信息
     **/
    public JSONObject sendMpTemplate(SendTempMessage sendTempMessage) throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/17
     * @methods: sendMpTemplate
     * @param: sendTempMessage
     * @return:  JSONObject
     * @description: 发送微信模板信息
     **/
    public JSONObject sendWxTemplate(SendTempMessage sendTempMessage) throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/17
     * @methods: getWxOpenIdByCoupRec
     * @param: entity
     * @return: String openId
     * @description: 通过订单记录ID获取openId
     **/
    public String getWxOpenIdByOrder(SendTempMessage entity) throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/17
     * @methods: getWxOpenIdByCoupRec
     * @param: entity
     * @return: String openId
     * @description: 通过优惠券记录ID获取openId
     **/
    public String getWxOpenIdByCoupRec(SendTempMessage entity) throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/15
     * @methods: filterStr
     * @param:  String
     * @return:  String
     * @description: 过滤字符串转化为指定格式
     **/
    public String filterStr(String str) throws  Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/14
     * @methods: queryVauleByOrder
     * @param: temTable
     * @return: String value
     * @description: 以订单表为基准获取地址类型参数值
     **/
    public String queryAddressVauleByOrder(TemTable temTable)throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/14
     * @methods: queryVauleByDepartureReport
     * @param: temTable
     * @return: String value
     * @description: 以离店报告表为主表获取参数值
     **/
    public String queryVauleByDepartureReport(TemTable temTable)throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/14
     * @methods: queryVauleByAppLogin
     * @param: temTable
     * @return: String value
     * @description: 以用户登录表为主表获取参数值
     **/
    public String queryVauleByAppLogin(TemTable temTable)throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/24
     * @methods: queryListVauleByOrder
     * @param: temTable
     * @return: String value
     * @description: 获取订单状态的值列表显示值
     **/
    public String  queryListVauleByOrder(TemTable temTable)throws Exception;

    /**
     *@createdBy 闫有霞
     *@date 2018/12/14
     *@methods: getWxOpenIdByDepartureReport
     *@param: String paramId   参数记录ID
     *         *@return: String value
     *@description: 获取微信的openId
     **/
    public String  getWxOpenIdByDepartureReport(SendTempMessage entity) throws Exception;

    /**
     *@createdBy 闫有霞
     *@date 2018/12/14
     *@methods: getWxOpenIdByAppLogin
     *@param: String paramId   参数记录ID
     *         *@return: String value
     *@description: 获取微信的openId
     **/
    public String  getWxOpenIdByAppLogin(SendTempMessage entity) throws Exception;

    /**
     *@createdBy 闫有霞
     *@date 2018/12/29
     *@methods: getMessageFormId
     *@param: String openId 当前登录人的openId
     *@return: String formId
     *@description:  获取保存到redis的formId
     **/
    public String getMessageFormId(String openId) throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/14
     * @methods: queryValueByStore
     * @param: temTable
     * @return: String value
     * @description: 查询门店信息
     **/
    public String queryValueByStore(TemTable temTable)throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2018/12/14
     * @methods: queryVauleByTransac
     * @param: temTable
     * @return: String value
     * @description: 以会员交易表为基准获取参数值
     **/
    public String queryVauleByTransac(TemTable temTable)throws Exception;

    /**
     *@createdBy 闫有霞
     *@date 2018/12/14
     *@methods: getWxOpenIdByTransac
     *@param: String paramId   参数记录ID
     *         *@return: String value
     *@description: 获取微信的openId
     **/
    public String  getWxOpenIdByTransac(SendTempMessage entity) throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2019/1/18
     * @methods: sendTemplateMessage
     * @param:  entity
     * @return:
     * @description: 发送模板信息
     **/
    public Map<String, Object> sendTemplateMessage(SendTempMessage entity) throws Exception;

    /**
     * 获取data参数及page跳转页面参数
     *
     * @author 路江
     * @date 2019-1-6
     * @param entity
     * @return
     * @throws Exception
     */
    public SendTempMessage getParamsTest(SendTempMessage entity) throws Exception;
}


